package org.seler.spring.ioc.ContainerExtensionPoints;

import org.springframework.beans.BeansException;

public class LoalBeanPostProcessor implements org.springframework.beans.factory.config.BeanPostProcessor{

	public Object postProcessAfterInitialization(Object bean, String beanName)
			throws BeansException {
		System.out.println("===after initialization===");
		System.out.println("'Bean' " +beanName + "created:" + bean.toString());
		return bean;
	}

	public Object postProcessBeforeInitialization(Object bean, String beanName)
			throws BeansException {
		System.out.println("===before initialization===");
		if(beanName.equals("Bean_1" )) {
			Bean_1 bean_1 = (Bean_1)bean;
			bean_1.setName("defalut_name");
			System.out.println("set the defalut_name for Bean_1");
		}
		return bean;
	}

}
